#pragma once
#include "Singleton.h"
#include "MysqlDao.h"
#include "const.h"

class MysqlMgr :public Singleton<MysqlMgr>
{
	friend class Singleton<MysqlMgr>;
public:
    ~MysqlMgr();
    int RegUser(const std::string& name, const std::string& email, const std::string& pwd);
    bool CheckEmail(const std::string& name, const std::string& email) {
        return _dao.CheckEmail(name, email);
    }
    bool UpdataPwd(const std::string& name, const std::string& pwd) {
        return _dao.UpdataPwd(name, pwd);
    }
    bool CheckPwd(const std::string& name, const std::string& pwd, UserInfo& userInfo) {
        return _dao.CheckPwd(name, pwd, userInfo);
    }

private:
    MysqlMgr();
    MysqlDao  _dao;
};

